package io.github.uicdb.et.item.weapon;

import com.google.common.collect.ImmutableMap;
import io.github.uicdb.et.ModHelper;
import io.github.uicdb.et.ModItemDataComponents;
import io.github.uicdb.et.element.BasicElement;
import io.github.uicdb.et.item_data.ItemElementData;
import net.minecraft.core.Holder;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.*;
import org.jetbrains.annotations.NotNull;

import java.util.Map;

public abstract class ExtraDamageWeapon extends Item implements IExtraDamageProvider{


    public ExtraDamageWeapon(Properties properties, ItemElementData data) {
        super(properties.component(ModItemDataComponents.ITEM_ELEMENT_DATA, data));
    }


    private Map<Holder<BasicElement>, Float> elementMap;

    @Override
    public Map<Holder<BasicElement>, Float> getElementMap() {
        if (elementMap == null) {
            var builder = ImmutableMap.<Holder<BasicElement>, Float>builder();
            appendElementMap(builder);
            elementMap = builder.build();
        }
        return elementMap;
    }


}
